home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / gawk-3.000 / gawk-3 / gawk-3.0.0 / Makefile.in < prev    next >
Encoding:
Makefile  |  1996-01-08  |  6.4 KB  |  254 lines

  1. # Makefile for GNU Awk.
  2. #
  3. # Copyright (C) 1986, 1988-1995 the Free Software Foundation, Inc.
  4. # This file is part of GAWK, the GNU implementation of the
  5. # AWK Programming Language.
  6. # GAWK is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. # GAWK is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
  17.  
  18. @SET_MAKE@
  19.  
  20. MAKEINFO = makeinfo --no-split
  21.  
  22. srcdir = @srcdir@
  23. VPATH = @srcdir@
  24.  
  25. CC = @CC@
  26. YACC = @YACC@
  27.  
  28. INSTALL = @INSTALL@
  29. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  30. INSTALL_DATA = @INSTALL_DATA@
  31.  
  32. LIBS = @LIBS@
  33.  
  34. ALLOCA = @ALLOCA@
  35.  
  36. exec_prefix = @exec_prefix@
  37. prefix = @prefix@
  38. binprefix =
  39. manprefix =
  40.  
  41. bindir = @bindir@
  42. libdir = @libdir@
  43. manexta = 1
  44. mandir = @mandir@/man$(manexta)
  45. manext = .$(manexta)
  46. infodir = @infodir@
  47. datadir = @datadir@/awk
  48. libexecdir = @libexecdir@/awk
  49.  
  50. DEFPATH = ".:$(datadir)"
  51.  
  52. SHELL = /bin/sh
  53. CFLAGS = @CFLAGS@ -DGAWK -I. -I$(srcdir) @DEFS@
  54.  
  55. # object files
  56. AWKOBJS = array.o builtin.o eval.o field.o gawkmisc.o io.o main.o \
  57.     missing.o msg.o node.o re.o version.o
  58.  
  59. ALLOBJS = $(AWKOBJS) awktab.o
  60.  
  61. # GNUOBJS
  62. #    GNU stuff that gawk uses as library routines.
  63. GNUOBJS= getopt.o getopt1.o regex.o dfa.o $(ALLOCA)
  64.  
  65. # source and documentation files
  66. SRC = array.c builtin.c eval.c field.c gawkmisc.c io.c main.c \
  67.     missing.c msg.c node.c re.c version.c
  68.  
  69. ALLSRC= $(SRC) awktab.c
  70.  
  71. AWKSRC= awk.h awk.y custom.h $(ALLSRC) patchlevel.h protos.h
  72.  
  73. GNUSRC = alloca.c dfa.c dfa.h regex.c regex.h getopt.h getopt.c getopt1.c
  74.  
  75. COPIES = missing/system.c missing/tzset.c \
  76.     missing/memcmp.c missing/memcpy.c missing/memset.c \
  77.     missing/random.c missing/strncasecmp.c missing/strchr.c \
  78.     missing/strerror.c missing/strtod.c \
  79.     missing/strftime.c missing/strftime.3 
  80.  
  81. DOCS= doc/gawk.1 doc/gawk.texi doc/texinfo.tex
  82.  
  83. TEXFILES= doc/gawk.aux doc/gawk.cp doc/gawk.cps doc/gawk.fn doc/gawk.fns \
  84.       doc/gawk.ky doc/gawk.kys doc/gawk.pg doc/gawk.pgs doc/gawk.toc \
  85.       doc/gawk.tp doc/gawk.tps doc/gawk.vr doc/gawk.vrs
  86.  
  87. MISC =    NEWS COPYING FUTURES Makefile.in PROBLEMS README PORTS POSIX.STD \
  88.     configure configure.in acconfig.h configh.in ACKNOWLEDGMENT \
  89.     ChangeLog INSTALL LIMITATIONS install-sh mkinstalldirs aclocal.m4 \
  90.     stamp-h.in
  91.  
  92. OTHERS= amiga doc pc atari vms README_d posix awklib
  93.  
  94. ALLDOC= doc/gawk.dvi $(TEXFILES) doc/gawk.info*
  95.  
  96. # Release of gawk.  There can be no leading or trailing white space here!
  97. REL=3.0
  98.  
  99. # clear out suffixes list
  100. .SUFFIXES:
  101. .SUFFIXES: .c .o
  102.  
  103. .c.o:
  104.     $(CC) -c $(CFLAGS) $<
  105.  
  106. # rules to build gawk
  107. all:    gawk doc/all awklib/all
  108.  
  109. # stuff to make sure that configure has been run.
  110. $(srcdir)/configure:    configure.in aclocal.m4
  111.     cd $(srcdir) && autoconf
  112.  
  113. # autoheader might not change confh.in, so touch a stamp file
  114. $(srcdir)/configh.in:    stamp-h.in
  115. $(srcdir)/stamp-h.in:    configure.in aclocal.m4 acconfig.h
  116.     cd $(srcdir) && autoheader
  117.     date > $(srcdir)/stamp-h.in
  118.  
  119. config.h:    stamp-h
  120. stamp-h:    configh.in config.status
  121.     $(SHELL) ./config.status
  122.  
  123. Makefile:    Makefile.in config.status
  124.     $(SHELL) ./config.status
  125.  
  126. config.status:    configure
  127.     $(SHELL) ./config.status --recheck
  128.  
  129. gawk:    $(ALLOBJS) $(GNUOBJS) $(REOBJS)
  130.     $(CC) -o gawk $(LDFLAGS) $(ALLOBJS) $(GNUOBJS) $(REOBJS) -lm $(LIBS)
  131.  
  132. $(ALLOBJS):    awk.h dfa.h regex.h config.h custom.h
  133.  
  134. $(GNUOBJS):    config.h custom.h
  135.  
  136. # SunOS make's (at least) VPATH doesn't do subdirectories...
  137. # Solaris make doesn't allow $< in the actual rule
  138. gawkmisc.o:    $(srcdir)/amiga/gawkmisc.ami $(srcdir)/atari/gawkmisc.atr \
  139.         $(srcdir)/pc/gawkmisc.pc $(srcdir)/posix/gawkmisc.c \
  140.         $(srcdir)/vms/gawkmisc.vms
  141.     $(CC) -c $(CFLAGS) -DDEFPATH='$(DEFPATH)' $(srcdir)/gawkmisc.c
  142.  
  143. getopt.o:    getopt.h
  144.  
  145. getopt1.o:    getopt.h
  146.  
  147. main.o:    patchlevel.h
  148.  
  149. awktab.c:    awk.y
  150.     $(YACC) -v $(srcdir)/awk.y && \
  151.     if test -f y.tab.c ; then mv y.tab.c ytab.c ; else true ; fi && \
  152.     sed '/^extern char .malloc(), .realloc();$$/d' ytab.c >awktab.c && \
  153.     rm ytab.c
  154.  
  155. # VMS POSIX make won't apply the default .c.o rule to awktab.o for some reason
  156. awktab.o:    awktab.c awk.h
  157.     $(CC) -c $(CFLAGS) $(srcdir)/awktab.c
  158.  
  159. alloca.o:    alloca.c
  160.  
  161. install:    gawk info installdirs
  162.     $(INSTALL) gawk $(bindir) && chmod 755 $(bindir)/gawk
  163.     cd doc && $(MAKE) install
  164.     cd awklib && $(MAKE) install
  165.  
  166. installdirs: mkinstalldirs
  167.     $(srcdir)/mkinstalldirs $(bindir) $(datadir) \
  168.         $(libdir) $(infodir) $(mandir) $(libexecdir)
  169.  
  170. uninstall:
  171.     rm -f $(bindir)/gawk
  172.     cd doc && $(MAKE) uninstall
  173.     cd awklib && $(MAKE) uninstall
  174.     -rmdir $(datadir) $(libexecdir)
  175.  
  176. # auxiliary rules for release maintenance
  177. lint:    $(ALLSRC)
  178.     lint -hcbax $(CFLAGS) $(ALLSRC)
  179.  
  180. xref:
  181.     cxref -c $(CFLAGS) $(ALLSRC) | grep -v '    /' >xref
  182.  
  183. clean:
  184.     rm -rf gawk *.o core y.output
  185.     cd doc && $(MAKE) clean
  186.     cd test && $(MAKE) clean
  187.     cd awklib && $(MAKE) clean
  188.  
  189. distclean:    clean
  190.     rm -f Makefile TAGS tags *.orig *.rej */*.orig */*.rej awk.output \
  191.         gmon.out make.out config.h config.status config.cache \
  192.         config.log stamp-h
  193.     cd doc && $(MAKE) distclean
  194.     cd awklib && $(MAKE) distclean
  195.  
  196. mostlyclean:    clean
  197.  
  198. maintainer-clean:    distclean
  199.     @echo "This command is intended for maintainers to use; it"
  200.     @echo "deletes files that may require special tools to rebuild."
  201.     rm -f awktab.c
  202.     cd doc && $(MAKE) maintainer-clean
  203.     cd test && $(MAKE) maintainer-clean
  204.     cd awklib && $(MAKE) maintainer-clean
  205.  
  206. clobber:    maintainer-clean
  207.  
  208. TAGS:
  209.     etags $(AWKSRC)
  210.     ctags $(AWKSRC)
  211.  
  212. dvi:    $(srcdir)/doc/gawk.texi
  213.     cd doc && $(MAKE) dvi
  214.  
  215. info:    $(srcdir)/doc/gawk.texi
  216.     cd doc && $(MAKE) info
  217.  
  218. doc/all:
  219.     cd doc && $(MAKE) all
  220.  
  221. awklib/all:
  222.     cd awklib && $(MAKE) all
  223.  
  224. dist:    $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) $(COPIES) awklib/stamp-eg distclean
  225.     -rm -rf gawk-$(REL)*
  226.     dir=gawk-$(REL).`gawk '{print $$3}' patchlevel.h` && \
  227.     mkdir $$dir && \
  228.     cp -pr $(AWKSRC) $(GNUSRC) $(MISC) $$dir && \
  229.     mkdir $$dir/missing && \
  230.     cp -p $(COPIES) $$dir/missing && \
  231.     for i in $(OTHERS); \
  232.     do \
  233.         cp -pr $$i $$dir ; \
  234.     done && \
  235.     cp -pr test $$dir && \
  236.     (cd $$dir/doc; $(MAKEINFO) gawk.texi) && \
  237.     find $$dir -type d -exec chmod 777 {} ';' && \
  238.     find $$dir -print | doschk && \
  239.     tar -cf - $$dir | gzip > $$dir.tar.gz && \
  240.     rm -fr $$dir
  241.  
  242. awklib/stamp-eg:
  243.     cd awklib ; $(MAKE) stamp-eg
  244.  
  245. check:    gawk
  246.     cd test; $(MAKE) -k
  247.  
  248. test:    check
  249.  
  250.